package com.utooo.service.purchase;


import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.utooo.dao.purchase.PurchaseContractMapper;
import com.utooo.dao.purchase.report.ContractSettlementReportMapper;
import com.utooo.pojo.domain.purchase.contract.PurchaseContractDO;
import com.utooo.pojo.domain.purchase.report.ContractSettlementReportDO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: TODO
 * @Author SJD
 * @Date: 2025/4/30 14:21
 * @Copyright: 南京优通信息科技股份有限公司
 */
@Service
@RequiredArgsConstructor
public class ContractSettlementReportServiceImpl extends ServiceImpl<ContractSettlementReportMapper, ContractSettlementReportDO>
        implements ContractSettlementReportService {

    private final PurchaseContractMapper purchaseContractMapper;
    @Override
    public Boolean executeContractSettlement() {
        List<PurchaseContractDO> purchaseContractDOS = purchaseContractMapper.selectList(new LambdaQueryWrapper<>());
        ContractSettlementReportDO contractSettlementReportDO = BeanUtil.copyProperties(purchaseContractDOS, ContractSettlementReportDO.class);
        // 合同含税金额
        // 待验收金额 验收中金额 已验收金额
        // 待关联金额 预付款金额 关联中金额 已关联金额
        // 待核销金额 核销金额
        // 待付款金额 付款中金额 已付款金额
        // 退款金额


        this.save(contractSettlementReportDO);
        return Boolean.TRUE;
    }
}
